<html>
<head><meta charset="utf-8"><title>RUSTC_WORKSPACE_WRAPPER · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER.html">RUSTC_WORKSPACE_WRAPPER</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212366293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER/near/212366293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER.html#212366293">(Oct 05 2020 at 22:54)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> I would like to help in making <a href="https://github.com/rust-lang/cargo/issues/8143">cargo#8143</a> move forward.  It would be great to fix <a href="https://github.com/rust-lang/rust-clippy/issues/4612">clippy#4612</a> (ideally also <a href="https://github.com/rust-lang/cargo/issues/7862">cargo#7862</a> and <a href="https://github.com/rust-lang/rust-clippy/issues/3025">clippy#3025</a>). I'd prefer to start the discussion here to avoid cluttering the issue, but tell me if you prefer otherwise <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span> Also, I'm not super familiar with cargo terminology so don't hesitate to correct me if I didn't get something right.</p>
<p>Starting with the issue with cargo fix (<a href="https://github.com/rust-lang/cargo/issues/8143#issuecomment-619289546">this comment</a> and your second bullet point), from my tests the problem only manifests with path dependencies, which is <a href="https://github.com/rust-lang/cargo/issues/5998">cargo#5998</a>. Clippy runs because <code>--cap-lints allow</code> is not passed for path dependencies. I think the same argument given there (users are expected to have control over path dependencies) applies, but it's understandable to want a different behavior for Clippy (or tools in general). I think your suggestion about using  <code>CARGO_PRIMARY_PACKAGE</code> makes sense; this way tools could choose a different behavior than the default for non-primary crates.</p>
<hr>
<p>About the fourth bullet point (arguments for the wrapper), I think an env var is the simplest way to go. This is what Clippy uses currently. A problem with that is that variable is not known to cargo, so it's not tracked in the fingerprint/hash. Using <code>RUSTFLAGS</code> would solve the issue, but I'm afraid we would hit <a href="https://github.com/rust-lang/rust-clippy/issues/5214">clippy#5214</a> (rustc complains about unknown lints). We could solve that in rustc because it knows about Clippy, but not necessarily about other tools that would use the wrapper functionality, so I would avoid using <code>RUSTFLAGS</code>, and either add a "companion" variable to <code>RUSTC_WORKSPACE_WRAPPER</code>, or even allow <code>RUSTC_WORKSPACE_WRAPPER</code> to include the arguments to the wrapper.</p>
<hr>
<p>About your first bullet point (is this the right design); after reading all the issues related to <code>clippy-preview</code> (what an emotional rollercoaster <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span>) it's not clear to me what workspaces have to do with compiler wrappers. I think I understand how it solves the cache issues between check/clippy, but the relationship with workspaces seems accidental to me?</p>
<hr>
<p>Finally, about sccache, I'm not familiar with the tool and would prefer to address that after the rest of open questions take form.</p>
<p>Sorry about the long post, I hope all of this makes some sense <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="212396012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER/near/212396012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER.html#212396012">(Oct 06 2020 at 08:07)</a>:</h4>
<p>About the problem related to path dependencies, I've realized users can exclude the deps from the workspace. That would be another option to avoid deny lints in deps making the build fail.</p>



<a name="212418782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER/near/212418782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER.html#212418782">(Oct 06 2020 at 12:20)</a>:</h4>
<p>Worst case scenario, tools can parse the manifest and avoid running for dependencies if asked</p>



<a name="212461098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER/near/212461098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER.html#212461098">(Oct 06 2020 at 17:44)</a>:</h4>
<p>I think adding something like the <code>CARGO_PRIMARY_PACKAGE</code> env var is probably the best option for solving the issues.  I can't think of any better alternatives.  One concern is that what is "primary" isn't well defined, but I think we can deal with that.  Would you be willing to work on that?  It should be relatively simple (cargo used to set it in the past).</p>
<p>As for passing arguments, that's a general problem that I think we can defer.  We've talked about using TOML syntax in environment variables for that, although that is a little weird.</p>



<a name="212480956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER/near/212480956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER.html#212480956">(Oct 06 2020 at 20:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120518">Eric Huss</span> <a href="#narrow/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER/near/212461098">said</a>:</p>
<blockquote>
<p>Would you be willing to work on that?  It should be relatively simple (cargo used to set it in the past).</p>
</blockquote>
<p>Of course, I'll look into it.</p>
<blockquote>
<p>As for passing arguments, that's a general problem that I think we can defer. </p>
</blockquote>
<p>Alright, fixing the "clippy does not run after check" problem would be already nice <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="212486973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER/near/212486973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/RUSTC_WORKSPACE_WRAPPER.html#212486973">(Oct 06 2020 at 21:16)</a>:</h4>
<p>Opened <a href="https://github.com/rust-lang/cargo/issues/8758">cargo#8758</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>